package com.wing.chanjet.feign;

import com.wing.chanjet.entity.inventory.CurrentStockResponse;
import com.wing.chanjet.entity.inventory.InventoryClassResponse;
import com.wing.chanjet.entity.inventory.InventoryResponse;
import com.wing.chanjet.entity.inventory.InventoryUnitResponse;
import com.wing.chanjet.entity.material.MaterialCreateRequest;
import com.wing.chanjet.entity.others.OthersCreateRequest;
import com.wing.chanjet.entity.product.ProductCreateRequest;
import com.wing.chanjet.entity.sales.SalesCreateRequest;
import com.wing.chanjet.entity.shelfSpace.InvLocationCreateRequest;
import com.wing.chanjet.entity.shelfSpace.InvLocationQueryResponse;
import com.wing.chanjet.entity.supplier.request.SupplierCreateRequest;
import com.wing.chanjet.entity.supplier.request.SupplierPartnerClassCreateRequest;
import com.wing.chanjet.entity.supplier.response.SupplierPartnerClassResponse;
import com.wing.chanjet.entity.supplier.response.SupplierQueryResponse;
import com.wing.chanjet.entity.warehouse.request.PurchaseCreateDtoRequest;
import com.wing.chanjet.entity.warehouse.request.PurchaseCreateRequest;
import com.wing.chanjet.entity.warehouse.response.WarehouseQueryResponse;
import com.wing.common.utils.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "${chanjet.appName}", fallback = ChanjetClientFallback.class)
public interface ChanjetClient {

    /**
     * 仓库查询
     */
    @PostMapping("/warehouse/admin/warehouse/query")
    JsonResult<List<WarehouseQueryResponse>> warehouseQuery();

    /**
     * 存货分类查询
     */
    @PostMapping("/inventory/admin/inventory/class/query")
    JsonResult<List<InventoryClassResponse>> inventoryClassQuery();

    /**
     * 存货计量单位查询
     */
    @PostMapping("/inventory/admin/inventory/unit/query")
    JsonResult<List<InventoryUnitResponse>> inventoryUnitQuery(@RequestParam("code") String code);

    /**
     * 存货查询
     */
    @PostMapping("/inventory/admin/inventory/query")
    JsonResult<List<InventoryResponse>> inventoryQuery();

    /**
     * 现存量查询
     */
    @PostMapping("/inventory/admin/inventory/currentStock/query")
    JsonResult<List<CurrentStockResponse>> currentStockQuery();


    /**
     * 供应商查询
     */
    @PostMapping("/supplier/admin/supplier/getSupplierList")
    JsonResult<List<SupplierQueryResponse>> getSupplierList();



    /**
     * 创建供应商
     * @param supplierCreateRequest
     * @return
     */
    @PostMapping("/supplier/admin/supplier/createSupplier")
    JsonResult createSupplier(@RequestBody SupplierCreateRequest supplierCreateRequest);



    /**
     * 修改供应商
     * @param supplierCreateRequest
     * @return
     */
    @PostMapping("/supplier/admin/supplier/updateSupplier")
    JsonResult updateSupplier(@RequestBody SupplierCreateRequest supplierCreateRequest);


    /**
     * 供应商分类查询
     */
    @PostMapping("/supplier/admin/supplier/getSupplierListPartnerClass")
    JsonResult<List<SupplierPartnerClassResponse>> getSupplierListPartnerClass();


    /**
     * 创建供应商分类
     * @param supplierPartnerClassCreateRequest
     * @return
     */
    @PostMapping("/supplier/admin/supplier/createSupplierPartnerClass")
    JsonResult createSupplierPartnerClass(@RequestBody SupplierPartnerClassCreateRequest supplierPartnerClassCreateRequest);


    /**
     * 采购入库单（添加入库作业）
     * @param purchaseCreateRequest
     * @return
     */
    @PostMapping("/purchaseCjt/admin/purchaseCjt/syncAddPurchaseWork")
    JsonResult syncAddPurchaseWork(@RequestBody PurchaseCreateDtoRequest purchaseCreateRequest);


    /**
     * 获取畅捷通-货位数据信息列表
     * @return
     */
    @PostMapping("/invLocation/admin/invLocation/query")
    JsonResult<List<InvLocationQueryResponse>> getShelfSpaceData(@RequestParam("code") String code);

    /**
     * 创建畅捷通货位信息
     * @param invLocationCreateRequest
     * @return
     */
    @PostMapping("/invLocation/admin/invLocation/create")
    JsonResult syncAddShelfSpaceData(@RequestBody InvLocationCreateRequest invLocationCreateRequest);


    /**
     * 创建材料出库单
     * @param materialCreateRequest
     * @return
     */
    @PostMapping("/material/admin/material/syncAddMaterialDispatch")
    JsonResult syncAddMaterialDispatch(@RequestBody MaterialCreateRequest materialCreateRequest);


    /**
     * 创建销售出库单
     * @param salesCreateRequest
     * @return
     */
    @PostMapping("/sales/admin/sales/syncOutSalesDispatch")
    JsonResult syncOutSalesDispatch(@RequestBody SalesCreateRequest salesCreateRequest);



    /**
     * 产成品入库单创建
     * @param productCreateRequest
     * @return
     */
    @PostMapping("/product/admin/product/syncInProductReceive")
    JsonResult syncInProductReceive(@RequestBody ProductCreateRequest productCreateRequest);


    /**
     * 产成品入库单创建
     * @param othersCreateRequest
     * @return
     */
    @PostMapping("/others/admin/others/syncOutSalesDispatch")
    JsonResult syncOutSalesDispatch(@RequestBody OthersCreateRequest othersCreateRequest);


}
